package com.woniuxy.boot.common.pojo;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ResponseResult<T> {
    private int code;
    private String msg;
    private T data;
    public ResponseResult(int code, String msg) {
        this(code, msg, null);
    }
    public ResponseResult(T data) {
        this(200, "success", data);
    }
    public static final ResponseResult<Void> SUCCESS = new ResponseResult<Void>(200, "success");
    public static final ResponseResult<Void> FAIL = new ResponseResult<Void>(500, "fail");
}
